$(function(){
var tables = [
	{code: "all", desc: "全部"},
	{code: "MR_BASEINFO", desc: "MR_BASEINFO"},
	{code: "MR_IPINFO", desc: "MR_IPINFO"},
	{code: "MR_APPENDPAGE", desc: "MR_APPENDPAGE"},
	{code: "MR_DIAGNOSE", desc: "MR_DIAGNOSE"},
	{code: "MR_OPERATION", desc: "MR_OPERATION"}
]
createDataTable('all');

for(var i in tables){
	$("#" + tabId + " #tablename_id").append('<option value="'+tables[i].code+'">'+tables[i].desc+'</option>');
}
$("#" + tabId + " #tablename_id").on('change',function(){
	createDataTable ($("#" + tabId + " #tablename_id").val())
})
})
/**
 * 
 * @@param tables
 * @@returns
 * @any
 * @ Discription:获取表格数据
 * @showTableFiles.js
 */
function createDataTable (tables){
	
	$.post(contextPath + "/systemConfig/findTableFiles.dhc", {tableName:tables}).done(function(res){
		var data=res.data;
		var paramsDataTables={lengthChange:false,ordering:false};
		var columns=[ 
						{ "data": "COLUMN_NAME","title":"字段"},
						{ "data": "COMMENTS","title":"字段名称"},
						{ "data": "DATA_TYPE","title":"字段类型"},
						{ "data": "TABLE_NAME","title":"表名"}
	                 ];
		$('#'+tabId+' #tablefiles_id').dataTableBasic(columns,data,paramsDataTables);
	})
};
